<?php
/**
 * 邀请返利API控制器
 * @author 王勇程 <laughskydragon@qq.com>
 */

namespace app\api\controller;

use app\api\controller\ApiBase;

class Invite extends ApiBase
{
    /**
     * 生成邀请码
     */
    public function generateInviteCode()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->generateInviteCode($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 处理邀请关系
     */
    public function processInviteRelation()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->processInviteRelation($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 获取邀请统计
     */
    public function getUserInviteStats()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getUserInviteStats($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 获取用户余额
     */
    public function getUserBalance()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getUserBalance($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 获取邀请列表
     */
    public function getInviteList()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getInviteList($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 获取佣金记录
     */
    public function getCommissionLog()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getCommissionLog($data);
        return $this->apiReturn($result);
    }

    /**
     * 获取最近邀请佣金用户广告列表
     */
    public function getRecentCommissionUsers()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getRecentCommissionUsers($data);
        return $this->apiReturn($result);
    }
    

    
    /**
     * 获取邀请规则
     */
    public function getInviteRules()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getInviteRules($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 生成邀请二维码
     */
    public function generateQrcode()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->generateQrcode($data);
        return $this->apiReturn($result);
    }
    
    /**
     * 获取邀请信息
     */
    public function getInviteInfo()
    {
        $data = $this->request->param();
        $result = $this->logicInvite->getInviteInfo($data);
        return $this->apiReturn($result);
    }
}
